//
//  LRJudgeTableViewCell.m
//  本地生活圈
//
//  Created by admin on 15/8/16.
//  Copyright (c) 2015年 懒人. All rights reserved.
//
#import "LRJudgeTableViewCell.h"

@interface LRJudgeTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *userIcon;
@property (weak, nonatomic) IBOutlet UILabel *userName;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UIImageView *scoreImage;
@property (weak, nonatomic) IBOutlet UILabel *contant;


@end

@implementation LRJudgeTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setList:(LRCommentList *)list
{
    _list = list;
    [self.userIcon sd_setImageWithURL:[NSURL URLWithString:list.avatar]];
    self.userIcon.layer.cornerRadius = CGRectGetWidth(self.userIcon.frame) / 2.0;
    self.userIcon.layer.masksToBounds = YES;
    
    self.userName.text = list.name;
    self.dateLabel.text = list.date;
    self.contant.text = list.content;
    NSString *imageName = [NSString stringWithFormat:@"star_%d",list.score];
    self.scoreImage.image = [UIImage imageNamed:imageName];
    
    CGRect rect = [list.content boundingRectWithSize:CGSizeMake(kUIScreenW, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName :[UIFont systemFontOfSize:14]} context:nil];
    self.cellHeight = 60 + rect.size.height;
}

@end

